//
//  LcbApiService.h
//  lcb
//
//  Created by lcb on 2017/1/23.
//  Copyright © 2017年 liuchengbin. All rights reserved.
//

#import "LcbResponseCallback.h"
#import "LcbRequestParam.h"
#import "LcbJson.h"
@interface LcbApiService : NSObject
/**
 *  配置请求头
 *
 *  @param httpHeader 请求头
 */
+ (void)configHttpHeader:(NSDictionary *)httpHeader;

/**
 *  取消GET请求
 */
+ (void)cancelRequestWithURL:(NSString *)url;

/**
 *  取消所有请求
 */
+ (void)cancleAllRequest;
/**
 * json格式的请求方法
 * @param param 请求参数
 * @param clazz response对象的类型
 * @param loadingDelegate 上传进度反馈
 * @param loadCache 加载缓存的反馈
 * @param success 上传成功反馈
 * @param fail 上传失败反馈
 */
+(void)requestWithParam:(LcbRequestParam*)param
          progressBlock:(RequestProgressBlock)progressBlock
                success:(RequestSuccessBlock)successHandler
                failure:(RequestFailBlock)failureHandler;

+(void)requestWithParam:(LcbRequestParam*)param
         refreshRequest:(BOOL)refresh
                  cache:(BOOL)cache
          progressBlock:(RequestProgressBlock)progressBlock
                success:(RequestSuccessBlock)successHandler
                failure:(RequestFailBlock)failureHandler;
/**
 *  多文件上传
 *
 *  @param url           上传文件地址
 *  @param params           拼接参数
 *  @param datas         数据集合
 *  @param progressBlock 上传进度
 *  @param successBlock  成功回调
 *  @param failBlock     失败回调
 *
 *  @return 任务集合
 */
+ (void)uploadMultFileWithParams:(LcbRequestParam*)param
                         fileDatas:(NSArray *)datas
                      successBlock:(RequestSuccessBlock)successBlock
                         failBlock:(RequestFailBlock)failBlock;
/**
 *  文件下载
 *
 *  @param params           拼接参数
 *  @param progressBlock 下载进度
 *  @param successBlock  成功回调
 *  @param failBlock     下载回调
 *
 *  @return 返回的对象可取消请求
 */
+ (void)downloadWithParams:(LcbRequestParam*)param
                        progressBlock:(RequestProgressBlock)progressBlock
                         successBlock:(RequestSuccessBlock)successBlock
                            failBlock:(RequestFailBlock)failBlock;
@end
